package com.abc.exception;

/**
 * 错误码常量类
 * 统一管理系统的错误码和错误信息
 */
public class ErrorCode {

    // ==================== 通用错误码 ====================
    
    /**
     * 成功
     */
    public static final int SUCCESS = 200;
    
    /**
     * 参数错误
     */
    public static final int PARAM_ERROR = 400;
    
    /**
     * 未授权
     */
    public static final int UNAUTHORIZED = 401;
    
    /**
     * 禁止访问
     */
    public static final int FORBIDDEN = 403;
    
    /**
     * 资源不存在
     */
    public static final int NOT_FOUND = 404;
    
    /**
     * 请求方法不支持
     */
    public static final int METHOD_NOT_ALLOWED = 405;
    
    /**
     * 服务器内部错误
     */
    public static final int INTERNAL_ERROR = 500;
    
    // ==================== 业务错误码 ====================
    
    /**
     * 业务异常
     */
    public static final int BUSINESS_ERROR = 1000;
    
    /**
     * 用户相关错误
     */
    public static final int USER_ERROR = 2000;
    public static final int USER_NOT_FOUND = 2001;
    public static final int USER_NOT_LOGIN = 2002;
    public static final int USER_PERMISSION_DENIED = 2003;
    
    /**
     * 会话相关错误
     */
    public static final int SESSION_ERROR = 3000;
    public static final int SESSION_NOT_FOUND = 3001;
    public static final int SESSION_EXPIRED = 3002;
    public static final int SESSION_PERMISSION_DENIED = 3003;
    
    /**
     * 聊天相关错误
     */
    public static final int CHAT_ERROR = 4000;
    public static final int CHAT_MESSAGE_EMPTY = 4001;
    public static final int CHAT_MESSAGE_TOO_LONG = 4002;
    public static final int CHAT_SENSITIVE_WORD = 4003;
    
    /**
     * 参数校验错误
     */
    public static final int VALIDATION_ERROR = 5000;
    public static final int PARAM_VALIDATION_FAILED = 5001;
    public static final int PARAM_BIND_FAILED = 5002;
    public static final int PARAM_TYPE_MISMATCH = 5003;
    
    // ==================== 错误信息常量 ====================
    
    /**
     * 通用错误信息
     */
    public static final String MSG_SUCCESS = "操作成功";
    public static final String MSG_PARAM_ERROR = "参数错误";
    public static final String MSG_UNAUTHORIZED = "未授权访问";
    public static final String MSG_FORBIDDEN = "禁止访问";
    public static final String MSG_NOT_FOUND = "资源不存在";
    public static final String MSG_METHOD_NOT_ALLOWED = "请求方法不支持";
    public static final String MSG_INTERNAL_ERROR = "系统异常，请联系管理员";
    
    /**
     * 业务错误信息
     */
    public static final String MSG_BUSINESS_ERROR = "业务处理失败";
    public static final String MSG_USER_NOT_FOUND = "用户不存在";
    public static final String MSG_USER_NOT_LOGIN = "用户未登录";
    public static final String MSG_USER_PERMISSION_DENIED = "用户权限不足";
    public static final String MSG_SESSION_NOT_FOUND = "会话不存在";
    public static final String MSG_SESSION_EXPIRED = "会话已过期";
    public static final String MSG_SESSION_PERMISSION_DENIED = "会话权限不足";
    public static final String MSG_CHAT_MESSAGE_EMPTY = "消息内容不能为空";
    public static final String MSG_CHAT_MESSAGE_TOO_LONG = "消息内容过长";
    public static final String MSG_CHAT_SENSITIVE_WORD = "消息包含敏感词";
    public static final String MSG_PARAM_VALIDATION_FAILED = "参数校验失败";
    public static final String MSG_PARAM_BIND_FAILED = "参数绑定失败";
    public static final String MSG_PARAM_TYPE_MISMATCH = "参数类型转换失败";
}

